<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="./10-Promise自定义封装-class风格实现.js"></script>
</head>
<body>
  <script>
    let p1 = new Promise((resolve,reject)=>{
      // setTimeout(() => {
        // resolve('hello p1')
        // reject('hello error')
      // }, 1000);
      // resolve('hello p1')
      reject('hello error');
    });
    console.log(p1);
    p1.then(res=>{
      console.log('then--',res);
    }).catch(err=>{
      console.log('catch--',err);
    })
    console.log(Promise.resolve('hahaha'));
  </script>
</body>
</html>